#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

char find(char* arr, int k)
{
	while(*arr!='\0')
	{
		int i = 1;
		char a = *arr;
		while (*++arr == a)
			i++;
		if (i == k)
			return a;
	}
	return 0;
}

int main()
{
	int k = 0;
	scanf("%d", &k);
	char str[100] = { 0 };
	scanf("%s", str);
	char ch = 0;
	ch = find(str, k);
	if (ch != 0)
		printf("%c", ch);
	else
		printf("NO\n");
	return 0;
}